package com.dongdongshop.data;

//枚举类 ：把所有的状态都一一列举出来
public enum HttpResponseEnum {
    OK(200, "ok"), FAIL(500, "fail"), UNATUTH(401, "Unauthorized");

    private Integer index;
    private String name;

    HttpResponseEnum(Integer index, String name) {
        this.index = index;
        this.name = name;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //测试枚举方法
    public static void main(String[] args) {
        HttpResponseEnum httpResponseEnum=HttpResponseEnum.OK;
        System.out.println("index"+httpResponseEnum.getIndex());
        System.out.println("name"+httpResponseEnum.getName());
    }
}
